package com.coocaa.typhoon.api.v1.userfile.model;

import com.coocaa.cirrus.common.base.model.MetaDataModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.UtilityClass;

/**
 * @author bijiahao
 * @date : 2025/9/19 21:52
 * @description
 */
@Builder
@Data
public class UploadTmpResult {
    /**
     * tos://{tosBucketName}/{filePath}
     */
    private String tosLink;
    /**
     * http访问地址
     */
    private String url;
    /**
     * 文件扩展名
     */
    private String fileExtName;
    /**
     * 文件名
     */
    private String fileName;

    private String shootTime;
    private String location;
    @Schema(description = "时长/毫秒")
    private Integer duration;

    public void setMetaData(MetaDataModel metaDataModel) {
        if (null == metaDataModel) {
            return;
        }
        setLocation(null == metaDataModel.getLocation() ? "" : metaDataModel.getLocation());
        setShootTime(null == metaDataModel.getShootTime() ? "" : metaDataModel.getShootTime());
    }
}
